package com.eazy.lkv2.web.controller.blog;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import com.eazy.lkv2.web.controller.BaseController;
import com.eazy.lkv2.web.entity.blog.Category;
import com.eazy.lkv2.web.entity.blog.Friend;
import com.eazy.lkv2.web.entity.blog.Tag;
import com.eazy.lkv2.web.service.blog.CategoryService;
import com.eazy.lkv2.web.service.blog.FriendService;
import com.eazy.lkv2.web.service.blog.TagService;

/**
 * 
 * @author jzx
 * 
 * @date 2016-11-08 10:28:40 星期二
 */
@Controller
public class HomeController extends BaseController<Object, String> {

	@Autowired
	private CategoryService categoryService;
	
	@Autowired
	private TagService tagService;
	
	@Autowired
	private FriendService friendService;
	
	@RequestMapping("/")
	public String home(ModelMap map) {
		// 栏目列表
		List<Category> categoryList = categoryService.getCategoryList();
		// 标签列表
		List<Tag> tagList = tagService.getTagList();
		// 合作伙伴列表
		List<Friend> friendList = friendService.getAllFriendList();
		
		map.put("categoryList", categoryList);
		map.put("tagList", tagList);
		map.put("friendList", friendList);
		return "/blog/home";
	}
}
